package com.azusa.xbiao.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "goods_image", schema = "xbiaoshop")
public class GoodsImage {
    private int pid;
    private String imagUrl;
    private Byte assign;

    @Id
    @Column(name = "pid", nullable = false)
    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }



    @Basic
    @Column(name = "image_url", nullable = true, length = 255)
    public String getImagUrl() {
        return imagUrl;
    }

    public void setImagUrl(String imagUrl) {
        this.imagUrl = imagUrl;
    }

    @Basic
    @Column(name = "assign", nullable = true)
    public Byte getAssign() {
        return assign;
    }

    public void setAssign(Byte assign) {
        this.assign = assign;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        GoodsImage that = (GoodsImage) o;
        return pid == that.pid &&
                Objects.equals(imagUrl, that.imagUrl) &&
                Objects.equals(assign, that.assign);
    }

    @Override
    public int hashCode() {
        return Objects.hash(pid, imagUrl, assign);
    }

    @Override
    public String toString() {
        return "GoodsImage{" +
                "pid=" + pid +
                ", imagUrl='" + imagUrl + '\'' +
                ", assign=" + assign +
                '}';
    }
}
